<?
session_start();
if (!isset($_SESSION[login])) {
     header("Location: HomeIndex.php");
     exit;
}
require("connectDB.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>View Admin</title>
<meta charset="utf-8">
<meta name="description" content="Place your description here">
<meta name="keywords" content="put, your, keyword, here">
<meta name="author" content="Templates.com - website templates provider">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<!--[if lt IE 7]>
     <link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="screen">
     <script type="text/javascript" src="js/ie_png.js"></script>
     <script type="text/javascript">
        ie_png.fix('.png, footer, header nav ul li a, .nav-bg, .list li img');
     </script>
<![endif]-->
<!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
  <![endif]-->
    <script type="text/javascript">
  <!--
	function error(){
		alert("ไม่อนุญาตให้ดาวน์โหลด");
  }
  //-->
  </script>
</head>
<body id="page1">
<div class="wrap">
   <!-- header -->
   <header>
      <div class="container">
         <h1><a href="homeAdmin.php">Student Portfolio Management System</a></h1>
         <nav>
            <ul>
               <li><a href="homeAdmin.php" class="m1">หน้าแรก</a></li>
               <li class="current"><a href="searchAdmin.php" class="m1">ค้นหา</a></li>
               <li><a href="uploadAdmin.php" class="m1">อัพโหลด</a></li>
               <li><a href="manageAdmin.php" class="m3">จัดการข้อมูลเบื้องต้น</a></li>
               <li class="last"><a href="reportAdmin.php" class="m3">ออกรายงาน</a></li>
            </ul>
         </nav>
         <form action="" id="search-form">
            <fieldset>
            <div class="rowElem">
               <input type="text">
               <a href="#" onClick="document.getElementById('search-form').submit()">ค้นหา</a></div>
            </fieldset>
         </form>
      </div>
   </header>
   <div class="container">
      <!-- aside -->
      <aside>
         <div class="wrap">
   <!-- header -->
   <div class="container">
      <!-- aside -->
      <aside><h2 align ="left">ยินดีต้อนรับ</h2> 
      <input name="editSelf" type="button" value="แก้ไขข้อมูลส่วนตัว" onClick="window.location='editselfAdmin.php'"><br><br>
      <input name="logOut" type="button" value="ออกจากระบบ" onClick="window.location='logout.php'">
</aside>	 
      <!-- content -->
      <section id="content">   
         <div class="inside">       
         </div>
      </section>
   </div>
</div>
      </aside>
      <!-- content -->
      <section id="content">
         <div class="inside">
	<p class="style30">ข้อมูลผลงาน</p>
  <hr/>
  

<table cellpadding="5">
<?
$tmp="select * from project where project_id='$pid';";
$sql = mysql_query($tmp);
while($result = mysql_fetch_array($sql))    {
?>
<TR>
<TD  valign="middle" height="30"><b>ชื่อผลงาน</b></TD>
<TD  valign="middle" height="30"><? echo $result["project_name"]; ?></TD>
<br>
</TR>
<TR>
<TD  valign="middle" height="30"><b>ชื่อเจ้าของผลงาน</b></TD>
<TD  valign="middle" height="30"><? echo $result["owner_name"]; ?></TD>
</TR>
<TR>
<TD valign="middle" height="30"><b>รหัสนักศึกษา</b></TD>
<TD valign="middle" height="30"><? echo $result["student_id"]; ?></TD>
</TR>
<TR>
<TD valign="middle" height="30"><b>สาขาวิชา</b></TD>
<TD valign="middle" height="30"><? echo $result["major"]; ?></TD>
</TR>
<TR>
<TD valign="middle" height="30"><b>รายวิชา</b></TD>
<TD valign="middle" height="30"><? echo $result["subject"]; ?></TD>
</TR>
<TR>
<TD valign="middle" height="30"><b>อาจารย์ประจำวิชา</b></TD>
<TD valign="middle" height="30"><? echo $result["subject_teacher"]; ?></TD>
</TR>
<TR>
<TD valign="middle" height="30"><b>อีเมล์(E-mail)</b></TD>
<? if($result["email"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><? echo $result["email"]; ?></TD><?}?>
</TR>
<TR>
<TD valign="middle" height="30"><b>เฟสบุ๊ค(Facebook)</b></TD>
<? if($result["facebook"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD  valign="middle" height="30"><? echo $result["facebook"]; ?></TD><?}?>
</TR>
<TR>
<TD  valign="middle"height="30"><b>รายละเอียดผลงาน</b></TD>
<TD valign="middle" height="30"><? echo $result["comment_text"]; ?></TD>
</TR>
<TR>
<TD valign="middle" height="30"><b>ประเภทผลงาน</b></TD>
<TD valign="middle" height="30"><? echo $result["project_type"]; ?></TD>
</TR>
<tr>
<TD valign="middle" height="30"><b>สถานะผลงาน</b></TD>
<TD valign="middle" height="30"><? echo $result["project_status"]; ?></TD>
</TR>
<?if($result["project_status"]=="ไม่อนุญาต"){?>
<TR>
<TD valign="middle" height="30"><b>เดโมระบบ</b></TD>
<? if($result["demo_file"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><a onclick="error()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Download','','images/btn_download/btn_download_2.gif',1)"><img src="images/btn_download/btn_download_1.gif" alt="ดาวน์โหลดผลงาน" width="100" height="30" id="Download"></a></TD><?}?>
</TR>
</TR>
<TD valign="middle" height="30"><b>คู่มือการใช้งาน</b></TD>
<? if($result["guide"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><a onclick="error()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Download','','images/btn_download/btn_download_2.gif',1)"><img src="images/btn_download/btn_download_1.gif" alt="ดาวน์โหลดผลงาน" width="100" height="30" id="Download"></a></TD>
<?}?>
</TR>
</TR>
<TD valign="middle" height="30"><b>ตัวเต็มระบบ</b></TD>
<? if($result["guide"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><a onclick="error()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Download','','images/btn_download/btn_download_2.gif',1)"><img src="images/btn_download/btn_download_1.gif" alt="ดาวน์โหลดผลงาน" width="100" height="30" id="Download"></a></TD>
<?}}
else {
?>
</TR>
<TR>
<TD valign="middle" height="30"><b>เดโมระบบ</b></TD>
<? if($result["demo_file"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><a href="TheFile/Demo/<?=$result["demo_file"];?>" target="_blank" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Download','','images/btn_download/btn_download_2.gif',1)"><img src="images/btn_download/btn_download_1.gif" alt="ดาวน์โหลดผลงาน" width="100" height="30" id="Download"></a></TD><?}?>
</TR>
</TR>
<TD valign="middle" height="30"><b>คู่มือการใช้งาน</b></TD>
<? if($result["guide"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><a href="TheFile/Guide/<?=$result["guide"];?>" target="_blank" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Download','','images/btn_download/btn_download_2.gif',1)"><img src="images/btn_download/btn_download_1.gif" alt="ดาวน์โหลดผลงาน" width="100" height="30" id="Download"></a></TD>
<?}?>
</TR>
</TR>
<TD valign="middle" height="30"><b>ตัวเต็มระบบ</b></TD>
<? if($result["guide"]=="") {?><TD valign="middle" height="30">-</td><?}
else {?><TD valign="middle" height="30"><a href="TheFile/Demo/<?=$result["demo_file"];?>" target="_blank" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Download','','images/btn_download/btn_download_2.gif',1)"><img src="images/btn_download/btn_download_1.gif" alt="ดาวน์โหลดผลงาน" width="100" height="30" id="Download"></a></TD>
<?}}?>
</TR>
</table> 
<? }
mysql_free_result($sql);
mysql_close($con); ?> 
      </section>  
</body>
</html>
